home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / bipl.zip / PROGS.ZIP / QT.ICN < prev    next >
Text File  |  1992-11-26  |  871b  |  40 lines

  1. ############################################################################
  2. #
  3. #    File:     qt.icn
  4. #
  5. #    Subject:  Program to announce time in English
  6. #
  7. #    Author:   Robert J. Alexander
  8. #
  9. #    Date:     May 20, 1992
  10. #
  11. ###########################################################################
  12. #
  13. #  Usage: qt [-a]
  14. #
  15. #  If -a is present, only the time is printed (for use in scripts), e.g.:
  16. #
  17. #    just after a quarter to three
  18. #
  19. #  otherwise, the time is printed as a sentence:
  20. #
  21. #    It's just after a quarter to three.
  22. #
  23. ############################################################################
  24.  
  25. link saytime
  26.  
  27. procedure main(arg)
  28.    local pre,suf
  29.    if arg[1] == "-a" then {
  30.       pop(arg)
  31.       pre := suf := ""
  32.       }
  33.    else {
  34.       pre := "It's "
  35.       suf := "."
  36.       }
  37.    arg[1] | put(arg)
  38.    every write(pre,saytime(!arg),suf)
  39. end
  40.